Optimal. Leaf size=110 \[ -\frac {\sqrt {b} (3 a-2 b) \tan ^{-1}\left (\frac {\sqrt {b} \sec (e+f x)}{\sqrt {a-b}}\right )}{2 a^2 f (a-b)^{3/2}}-\frac {\tanh ^{-1}(\cos (e+f x))}{a^2 f}-\frac {b \sec (e+f x)}{2 a f (a-b) \left (a+b \sec ^2(e+f x)-b\right )} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.13, antiderivative size = 110, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 5, integrand size = 21, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.238, Rules used = {3664, 414, 522, 207, 205} \[ -\frac {\sqrt {b} (3 a-2 b) \tan ^{-1}\left (\frac {\sqrt {b} \sec (e+f x)}{\sqrt {a-b}}\right )}{2 a^2 f (a-b)^{3/2}}-\frac {\tanh ^{-1}(\cos (e+f x))}{a^2 f}-\frac {b \sec (e+f x)}{2 a f (a-b) \left (a+b \sec ^2(e+f x)-b\right )} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 205
Rule 207
Rule 414
Rule 522
Rule 3664
Rubi steps
\begin {align*} \int \frac {\csc (e+f x)}{\left (a+b \tan ^2(e+f x)\right )^2} \, dx &=\frac {\operatorname {Subst}\left (\int \frac {1}{\left (-1+x^2\right ) \left (a-b+b x^2\right )^2} \, dx,x,\sec (e+f x)\right )}{f}\\ &=-\frac {b \sec (e+f x)}{2 a (a-b) f \left (a-b+b \sec ^2(e+f x)\right )}+\frac {\operatorname {Subst}\left (\int \frac {2 a-b-b x^2}{\left (-1+x^2\right ) \left (a-b+b x^2\right )} \, dx,x,\sec (e+f x)\right )}{2 a (a-b) f}\\ &=-\frac {b \sec (e+f x)}{2 a (a-b) f \left (a-b+b \sec ^2(e+f x)\right )}+\frac {\operatorname {Subst}\left (\int \frac {1}{-1+x^2} \, dx,x,\sec (e+f x)\right )}{a^2 f}-\frac {((3 a-2 b) b) \operatorname {Subst}\left (\int \frac {1}{a-b+b x^2} \, dx,x,\sec (e+f x)\right )}{2 a^2 (a-b) f}\\ &=-\frac {(3 a-2 b) \sqrt {b} \tan ^{-1}\left (\frac {\sqrt {b} \sec (e+f x)}{\sqrt {a-b}}\right )}{2 a^2 (a-b)^{3/2} f}-\frac {\tanh ^{-1}(\cos (e+f x))}{a^2 f}-\frac {b \sec (e+f x)}{2 a (a-b) f \left (a-b+b \sec ^2(e+f x)\right )}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 0.90, size = 184, normalized size = 1.67 \[ \frac {-\frac {2 a b \cos (e+f x)}{(a-b) ((a-b) \cos (2 (e+f x))+a+b)}+\frac {\sqrt {b} (3 a-2 b) \tan ^{-1}\left (\frac {\sqrt {a-b}-\sqrt {a} \tan \left (\frac {1}{2} (e+f x)\right )}{\sqrt {b}}\right )}{(a-b)^{3/2}}+\frac {\sqrt {b} (3 a-2 b) \tan ^{-1}\left (\frac {\sqrt {a-b}+\sqrt {a} \tan \left (\frac {1}{2} (e+f x)\right )}{\sqrt {b}}\right )}{(a-b)^{3/2}}+2 \log \left (\sin \left (\frac {1}{2} (e+f x)\right )\right )-2 \log \left (\cos \left (\frac {1}{2} (e+f x)\right )\right )}{2 a^2 f} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [B] time = 0.62, size = 470, normalized size = 4.27 \[ \left [-\frac {2 \, a b \cos \left (f x + e\right ) - {\left ({\left (3 \, a^{2} - 5 \, a b + 2 \, b^{2}\right )} \cos \left (f x + e\right )^{2} + 3 \, a b - 2 \, b^{2}\right )} \sqrt {-\frac {b}{a - b}} \log \left (\frac {{\left (a - b\right )} \cos \left (f x + e\right )^{2} + 2 \, {\left (a - b\right )} \sqrt {-\frac {b}{a - b}} \cos \left (f x + e\right ) - b}{{\left (a - b\right )} \cos \left (f x + e\right )^{2} + b}\right ) + 2 \, {\left ({\left (a^{2} - 2 \, a b + b^{2}\right )} \cos \left (f x + e\right )^{2} + a b - b^{2}\right )} \log \left (\frac {1}{2} \, \cos \left (f x + e\right ) + \frac {1}{2}\right ) - 2 \, {\left ({\left (a^{2} - 2 \, a b + b^{2}\right )} \cos \left (f x + e\right )^{2} + a b - b^{2}\right )} \log \left (-\frac {1}{2} \, \cos \left (f x + e\right ) + \frac {1}{2}\right )}{4 \, {\left ({\left (a^{4} - 2 \, a^{3} b + a^{2} b^{2}\right )} f \cos \left (f x + e\right )^{2} + {\left (a^{3} b - a^{2} b^{2}\right )} f\right )}}, -\frac {a b \cos \left (f x + e\right ) + {\left ({\left (3 \, a^{2} - 5 \, a b + 2 \, b^{2}\right )} \cos \left (f x + e\right )^{2} + 3 \, a b - 2 \, b^{2}\right )} \sqrt {\frac {b}{a - b}} \arctan \left (-\frac {{\left (a - b\right )} \sqrt {\frac {b}{a - b}} \cos \left (f x + e\right )}{b}\right ) + {\left ({\left (a^{2} - 2 \, a b + b^{2}\right )} \cos \left (f x + e\right )^{2} + a b - b^{2}\right )} \log \left (\frac {1}{2} \, \cos \left (f x + e\right ) + \frac {1}{2}\right ) - {\left ({\left (a^{2} - 2 \, a b + b^{2}\right )} \cos \left (f x + e\right )^{2} + a b - b^{2}\right )} \log \left (-\frac {1}{2} \, \cos \left (f x + e\right ) + \frac {1}{2}\right )}{2 \, {\left ({\left (a^{4} - 2 \, a^{3} b + a^{2} b^{2}\right )} f \cos \left (f x + e\right )^{2} + {\left (a^{3} b - a^{2} b^{2}\right )} f\right )}}\right ] \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [F(-2)] time = 0.00, size = 0, normalized size = 0.00 \[ \text {Exception raised: NotImplementedError} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.64, size = 179, normalized size = 1.63 \[ -\frac {b \cos \left (f x +e \right )}{2 f a \left (a -b \right ) \left (a \left (\cos ^{2}\left (f x +e \right )\right )-\left (\cos ^{2}\left (f x +e \right )\right ) b +b \right )}+\frac {3 b \arctan \left (\frac {\left (a -b \right ) \cos \left (f x +e \right )}{\sqrt {\left (a -b \right ) b}}\right )}{2 f a \left (a -b \right ) \sqrt {\left (a -b \right ) b}}-\frac {b^{2} \arctan \left (\frac {\left (a -b \right ) \cos \left (f x +e \right )}{\sqrt {\left (a -b \right ) b}}\right )}{f \,a^{2} \left (a -b \right ) \sqrt {\left (a -b \right ) b}}+\frac {\ln \left (-1+\cos \left (f x +e \right )\right )}{2 f \,a^{2}}-\frac {\ln \left (1+\cos \left (f x +e \right )\right )}{2 f \,a^{2}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [F(-2)] time = 0.00, size = 0, normalized size = 0.00 \[ \text {Exception raised: ValueError} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 13.72, size = 1140, normalized size = 10.36 \[ \frac {\ln \left (\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )\right )}{a^2\,f}-\frac {\frac {b}{a\,\left (a-b\right )}-\frac {{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^2\,\left (a\,b-2\,b^2\right )}{a^2\,\left (a-b\right )}}{f\,\left (a\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^4+\left (4\,b-2\,a\right )\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^2+a\right )}+\frac {\sqrt {b}\,\mathrm {atan}\left (\frac {\left ({\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^2\,\left (\frac {\left (\frac {b^{3/2}\,{\left (3\,a-2\,b\right )}^3\,\left (2\,a^{10}-58\,a^9\,b+306\,a^8\,b^2-686\,a^7\,b^3+772\,a^6\,b^4-432\,a^5\,b^5+96\,a^4\,b^6\right )}{8\,a^6\,{\left (a-b\right )}^{9/2}\,\left (-a^5+3\,a^4\,b-3\,a^3\,b^2+a^2\,b^3\right )}+\frac {2\,\sqrt {b}\,\left (3\,a-2\,b\right )\,\left (9\,a^5\,b-63\,a^4\,b^2+158\,a^3\,b^3-188\,a^2\,b^4+108\,a\,b^5-24\,b^6\right )}{a^2\,{\left (a-b\right )}^{3/2}\,\left (-a^5+3\,a^4\,b-3\,a^3\,b^2+a^2\,b^3\right )}\right )\,\left (27\,a^5-259\,a^4\,b+820\,a^3\,b^2-1164\,a^2\,b^3+768\,a\,b^4-192\,b^5\right )}{2\,a^5\,{\left (a-b\right )}^{9/2}\,\left (16\,a^3-39\,a^2\,b+36\,a\,b^2-12\,b^3\right )}-\frac {\left (\frac {8\,\left (9\,a^2\,b^2-12\,a\,b^3+4\,b^4\right )}{-a^5+3\,a^4\,b-3\,a^3\,b^2+a^2\,b^3}-\frac {b\,{\left (3\,a-2\,b\right )}^2\,\left (2\,a^8-35\,a^7\,b+234\,a^6\,b^2-611\,a^5\,b^3+746\,a^4\,b^4-432\,a^3\,b^5+96\,a^2\,b^6\right )}{2\,a^4\,{\left (a-b\right )}^3\,\left (-a^5+3\,a^4\,b-3\,a^3\,b^2+a^2\,b^3\right )}\right )\,\left (2\,a^4-47\,a^3\,b+186\,a^2\,b^2-240\,a\,b^3+96\,b^4\right )}{a^5\,\sqrt {b}\,{\left (a-b\right )}^3\,\left (16\,a^3-39\,a^2\,b+36\,a\,b^2-12\,b^3\right )}\right )+\frac {\left (\frac {\sqrt {b}\,\left (3\,a-2\,b\right )\,\left (12\,a^5\,b-53\,a^4\,b^2+60\,a^3\,b^3-20\,a^2\,b^4\right )}{a^2\,{\left (a-b\right )}^{3/2}\,\left (a^5-2\,a^4\,b+a^3\,b^2\right )}+\frac {b^{3/2}\,{\left (3\,a-2\,b\right )}^3\,\left (4\,a^{10}-24\,a^9\,b+52\,a^8\,b^2-48\,a^7\,b^3+16\,a^6\,b^4\right )}{16\,a^6\,{\left (a-b\right )}^{9/2}\,\left (a^5-2\,a^4\,b+a^3\,b^2\right )}\right )\,\left (27\,a^5-259\,a^4\,b+820\,a^3\,b^2-1164\,a^2\,b^3+768\,a\,b^4-192\,b^5\right )}{2\,a^5\,{\left (a-b\right )}^{9/2}\,\left (16\,a^3-39\,a^2\,b+36\,a\,b^2-12\,b^3\right )}-\frac {\left (\frac {4\,\left (9\,a^2\,b^2-12\,a\,b^3+4\,b^4\right )}{a^5-2\,a^4\,b+a^3\,b^2}-\frac {b\,{\left (3\,a-2\,b\right )}^2\,\left (4\,a^8-36\,a^7\,b+96\,a^6\,b^2-96\,a^5\,b^3+32\,a^4\,b^4\right )}{4\,a^4\,{\left (a-b\right )}^3\,\left (a^5-2\,a^4\,b+a^3\,b^2\right )}\right )\,\left (2\,a^4-47\,a^3\,b+186\,a^2\,b^2-240\,a\,b^3+96\,b^4\right )}{a^5\,\sqrt {b}\,{\left (a-b\right )}^3\,\left (16\,a^3-39\,a^2\,b+36\,a\,b^2-12\,b^3\right )}\right )\,\left (4\,a^7\,{\left (a-b\right )}^{9/2}-12\,a^6\,b\,{\left (a-b\right )}^{9/2}-4\,a^4\,b^3\,{\left (a-b\right )}^{9/2}+12\,a^5\,b^2\,{\left (a-b\right )}^{9/2}\right )}{9\,a^2\,b-12\,a\,b^2+4\,b^3}\right )\,\left (3\,a-2\,b\right )}{2\,a^2\,f\,{\left (a-b\right )}^{3/2}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [F(-1)] time = 0.00, size = 0, normalized size = 0.00 \[ \text {Timed out} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________